{% set clazz = "details white" %}
{% set title = "商品详情" %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" type="text/css" href="{{ '/static/css/integral.css'|version }}" />
{% endblock %}
{% block content %}
  {% if !nested %}
    <header class="bar bar-header">
      {{ macro.back() }}
      <h1 class="title">{{ title }}</h1>
    </header>
  {% endif %}
  <section class="has-footer">
    <div class="swipe" data-swipe="true">
      <div class="wrap">
        {% for item in entity.imageSrcList %}
          <div class="item">
            <div class="autofix">
              <img class="center-block" src="{{ item }}" />
            </div>
          </div>
        {% endfor %}
      </div>
    </div>
    <div class="vspace hspace">
      <strong>{{ entity.goodsName }}</strong>
      <span class="pull-right text-orange">{{ entity.consumeIntegral }} <i class="text-xs">积分</i></span>
    </div>
    <div class="flexbox text-center text-sm appendix">
      <a class="item text-black">库存量: {{ entity.inventory|default('不限') }}</a>
      <a class="item text-black" href="/integral/instruction">兑换说明</a>
    </div>
    {% if entity.goodsType === 'ENTITY' %}
      <!-- <span class="tiny through text-muted">市场价: {{ entity.marketPrice|currency }}</span> -->
    {% endif %}
    <div class="article">
      <strong>商品描述:</strong>
      <p>{{ entity.goodsDesc|safe|integralBreakwords }}</p>
    </div>
    <div class="vspace text-center text-sm text-gray expand">点击展开图文详情</div>
    <div class="article describe">
      <textarea class="lazyhtml">{{ entity.detail|rmstyle|safe }}</textarea>      
    </div>
  </section>
  <footer class="bar bar-footer bar-fixed bar-flat">
    {% if entity.goodsType === 'TICKET' %}
      <button class="button warning square exchange" data-id="{{ entity.id }}" data-type="TICKET" data-name="{{ entity.goodsName }}" data-integral="{{ entity.consumeIntegral }}">我要兑换</button>
    {% else %}
      <a class="button warning square" href="/integral/confirm/{{ entity.id }}">我要兑换</a>
    {% endif %}
  </footer>
{% endblock %}
{% block script %}
  {% parent %}
  <script src="{{ '/static/js/integral.js'|version }}"></script>
{% endblock %}